Skip to content

feat(i18n): add runtime localization.#2

Merged
Haerbin23456 merged 2 commits intomainfrom
feat/i18n-support
Mar 4, 2026
Merged

feat(i18n): add runtime localization.#2
Haerbin23456 merged 2 commits intomainfrom
feat/i18n-support

Conversation

@Haerbin23456
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds runtime, in-app localization support to the WPF UI by introducing a central LocalizationService, persisting language selection, and replacing hard-coded UI strings with localized bindings.

Changes:

  • Introduce LocalizationService (with language switching + in-memory resources) and UserPreferencesService (persist language selection).
  • Update XAML pages to bind UI text to LocalizationService.Instance[...] and add a language selector to Settings.
  • Localize key ViewModel-driven strings (navigation, status text, dialogs, notifications) and add a converter for localized null/empty fallbacks.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ContextMenuProfiler.UI/Views/Pages/SettingsPage.xaml Localizes Settings UI strings and adds Language selection UI.
ContextMenuProfiler.UI/Views/Pages/DashboardPage.xaml Replaces many hard-coded strings with localized bindings; adds localized null/empty converter usage.
ContextMenuProfiler.UI/ViewModels/SettingsViewModel.cs Adds language option list + selection logic; localizes Explorer restart dialog strings.
ContextMenuProfiler.UI/ViewModels/MainWindowViewModel.cs Localizes title/menu/tray items and reacts to runtime language changes.
ContextMenuProfiler.UI/ViewModels/DashboardViewModel.cs Localizes status strings and category labels; updates localization-change behavior.
ContextMenuProfiler.UI/MainWindow.xaml Localizes status-bar version text via localization service binding.
ContextMenuProfiler.UI/Core/Services/UserPreferencesService.cs New JSON-based preferences persistence (language code).
ContextMenuProfiler.UI/Core/Services/LocalizationService.cs New localization singleton with indexer-based resource lookup + runtime language switching.
ContextMenuProfiler.UI/Converters/NullOrEmptyToLocalizedConverter.cs New converter to replace null/empty display values with localized placeholders.
ContextMenuProfiler.UI/App.xaml.cs Initializes localization from saved preferences at startup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Haerbin23456 Haerbin23456 merged commit 84af31a into main Mar 4, 2026
1 of 2 checks passed
@Haerbin23456 Haerbin23456 deleted the feat/i18n-support branch March 4, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants